/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.meraklisina.latex;

import javax.swing.JTextPane;
import javax.swing.undo.UndoManager;
/**
 *
 * @author Spaceman
 */
public class LatexJTextPane extends JTextPane
{
    private boolean previouslySaved = false;
    private String filePath = "";
    private String fileName = "";
    private String fullPath = "";
    private Boolean isChanged = false;
    public UndoManager undo = new UndoManager();
    

    public boolean isPreviouslySaved() {
        return previouslySaved;
    }
    public void undo() {
        if (undo.canUndo()) {
            undo.undo();
        } else {
            System.out.println("Can't Undo!");
        }
    }
    public void redo() {
        if (undo.canRedo()) {
            undo.redo();
        } else {
            System.out.println("Can't Redo!");
        }
    }
    public void setPreviouslySaved(boolean previouslySaved) {
        this.previouslySaved = previouslySaved;
    }
    public void setChanged(Boolean b)
    {
        isChanged = b;
    }
    public Boolean getChanged()
    {
        return isChanged;
    }
    public void updateFileData(String s)
    {
        fullPath = s;        
    }
    public void updateFileData(String path, String name)
    {
        filePath    = path;
        fileName    = name;
    }

    public String getFilePath()
    {
        return filePath;
    }
    public void setFilePath(String s )
    {
        filePath = s;
    }
    public String getFileName()
    {
        return fileName;
    }
    public void setFileName(String s )
    {
        fileName = s;
    }
}
